package com.tzbank.wisdom.controller;

import com.tzbank.wisdom.service.SysSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 我的中心设置
 * zhangzehuan
 */
@Api(tags = {"设置"})
@Slf4j
@RequestMapping("sys")
@RestController
public class SysSettingController {

    @Autowired
    private SysSettingService sysSettingService;

    /**
     * 设置预留信息
     *
     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/sysNotice")
    @ApiOperation(value = "预留信息", notes = "预留信息接口")
    public Map<String, Object> saveNotice(@RequestBody Map<String, Object> reqBody) {
        return sysSettingService.saveNotice(reqBody);
    }

    @ResponseBody
    @PostMapping(value = "/getProfession")
    @ApiOperation(value = "获取职业信息", notes = "获取职业信息接口")
    public Map<String, Object> getProfession(@RequestBody Map<String,String> reqBody) {
        Map<String, Object> profession = sysSettingService.getProfession(reqBody);
        log.info("获取职业信息接口响应结果{}：" + profession);
        return profession;
    }
    
    @ResponseBody
    @PostMapping(value = "/updatePersonalInfo")
    @ApiOperation(value = "修改个人信息", notes = "修改个人信息接口")
    public Map<String, Object> updatePersonalInfo(@RequestBody Map<String, String> reqBody) {
        log.info("修改个人信息接口入参{}：" , reqBody);
        Map<String, Object>   resMap = sysSettingService.updatePersonalInfo(reqBody);
        log.info("修改职业信息接口响应结果{}：" , resMap);
        return resMap;
    }

    @ResponseBody
    @PostMapping(value = "/saveLoginName")
    @ApiOperation(value = "设置登录名", notes = "设置登录名接口")
    public Map<String, Object> saveLoginName(@RequestBody Map<String, Object> reqBody) {
        log.info("设置登录名接口入参{}：" , reqBody);
        return sysSettingService.saveLoginName(reqBody);
    }
    
    /**
     * 查询个人信息
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/getPersonalInfo")
    @ApiOperation(value = "查询个人信息", notes = "查询个人信息接口")
    public Map<String, Object> getPersonalInfo(@RequestBody Map<String, String> reqBody) {
        Map<String, Object> profession = sysSettingService.getPersonalInfo(reqBody);
        log.info("个人信息" + profession);
        return profession;
    }
    
    
    
}
